package com.atom.app.lifecycle.base

import androidx.lifecycle.ViewModel
import com.atom.app.lifecycle.MainViewModel
import com.atom.app.lifecycle.SplashViewModel
import com.atom.module.mvvm.base.viewmodel.AbstractViewModelFactory

object AppViewModelFactory : AbstractViewModelFactory() {

    override fun <T : ViewModel> create(modelClass: Class<T>): T {
        if (modelClass.isAssignableFrom(SplashViewModel::class.java)) {
            return SplashViewModel() as T
        }
        if (modelClass.isAssignableFrom(MainViewModel::class.java)) {
            return MainViewModel() as T
        }
        return super.create(modelClass)
    }
}
